/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pradoeditor.projectexplorer.menu;

import pradoeditor.comun.ItemProject;

/**
 *
 * @author jaime
 */
public class PopupMenuFactory
{

    /**
     *Permite crear un PopupMenu dependiendo el tipo de itemProject.
     *  Cada itemProject tiene asociado un conjunto de PopupMenu de forma predeterminada.
     * @param itemProject
     * @return
     */
    public static PopupMenu createPopupMenu(ItemProject itemProject)
    {
        PopupMenu popupMenu = null;

        if(itemProject.getType().equals(""))
        {
            popupMenu = new PopupMenuFolderCreator().FactoryMethod();
            popupMenu.setItemProject(itemProject);

        }else if(itemProject.getType().equals("page"))
        {
            popupMenu = new PopupMenuPageCreator().FactoryMethod();
            popupMenu.setItemProject(itemProject);
        }

        return popupMenu;
    }
}
